﻿// <copyright file="TestHelper.cs" company="Snowman Consulting">
//     Copyright (c) 2009 Snowman Consulting. All rights reserved.
// </copyright>

namespace SnowmanConsulting.ProductKeyManager.Test
{
    using SnowmanConsulting.ProductKeyManager.Data;

    /// <summary>
    /// Test Helper class
    /// </summary>
    internal static class TestHelper
    {
        /// <summary>
        /// Creates the expected products.
        /// </summary>
        /// <param name="expectedProducts">The expected products.</param>
        internal static void CreateExpectedProducts(ProductCollection expectedProducts)
        {
            Product p1 = new Product
            {
                Name = "Product 1",
                Category = "Category 1",
                Icon = new ProductIcon { IconUrl = "cmd.ico" },
                Notes = "Product 1 Notes"
            };

            ProductKey pk1 = new ProductKey
            {
                Code = "1234",
                AllocatedTo = "Computer1",
                Notes = "PK1 Notes"
            };

            p1.Keys.Add(pk1);

            expectedProducts.Add(p1);

            Product p2 = new Product
            {
                Name = "Product 2",
                Category = "Category 2",
                Icon = new ProductIcon { IconUrl = "cmd.ico" },
                Notes = "Product 2 Notes"
            };

            ProductKey pk2 = new ProductKey
            {
                Code = "ABCD",
                AllocatedTo = "Computer2",
                Notes = "PK2 Notes"
            };

            p2.Keys.Add(pk2);

            ProductKey pk3 = new ProductKey
            {
                Code = "AB-CD",
                AllocatedTo = "Computer1",
                Notes = "PK3 Notes"
            };

            p2.Keys.Add(pk3);

            expectedProducts.Add(p2);

            Product p3 = new Product
            {
                Name = "Product 3",
                Category = "Category 1",
                Icon = new ProductIcon { IconUrl = "cmd.ico" },
                Notes = "Product 3 Notes"
            };

            ProductKey pk4 = new ProductKey
            {
                Code = "1234",
                Notes = "PK1 Notes"
            };

            p3.Keys.Add(pk4);

            expectedProducts.Add(p3);

            Product p4 = new Product
            {
                Name = "Product 4",
                Category = "Category 4",
                Icon = new ProductIcon { IconUrl = "cmd.ico" },
                Notes = "Product 4 Notes"
            };

            expectedProducts.Add(p4);
        }
    }
}
